<script setup lang="ts">
import useBaseInstall from '@/composables/login/useBaseInstall'
import useInstall from '@/composables/login/useInstall'
const { installModel, installRules } = useBaseInstall()
const { isCanSubmit, submitText, installForm, installSave } = useInstall(installModel)
</script>
<template>
    <div class="install_container">
        <div class="container">
            <h1 ref="headTitle">后台配置</h1>
            <el-form :model="installModel" ref="installForm" :rules="installRules" label-width="120px">
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="baseURL" label="服务域名">
                            <el-input v-model="installModel.baseURL"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="serverPort" label="服务端口">
                            <el-input v-model="installModel.serverPort"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="mysqlAddr" label="数据库地址">
                            <el-input v-model="installModel.mysqlAddr"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="mysqlDBName" label="数据库名称">
                            <el-input v-model="installModel.mysqlDBName"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="mysqlUsername" label="数据库用户名">
                            <el-input v-model="installModel.mysqlUsername"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="mysqlPassword" label="数据库密码">
                            <el-input v-model="installModel.mysqlPassword"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="redisAddr" label="redis地址">
                            <el-input v-model="installModel.redisAddr"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" :offset="0">
                        <el-form-item prop="redisPassword" label="redis密码">
                            <el-input v-model="installModel.redisPassword"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item>
                    <el-button :disabled="!isCanSubmit" type="primary" @click="installSave">{{submitText}}</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>
<style lang="scss" scoped>

</style>